Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Hackaton/nodes and edges #531

Merged
merged 4 commits into from
Jun 19, 2023
Merged

Conversation

alfetopito
Copy link
Collaborator

Summary

Implements the new nodes and edges creation fn

Still not in use/tested etc

@vercel
Copy link

vercel bot commented Jun 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
explorer-dev 🔄 Building (Inspect) Jun 19, 2023 2:08pm

@alfetopito alfetopito merged commit 15fdd78 into hackaton-graph Jun 19, 2023
@alfetopito alfetopito deleted the hackaton/nodes-and-edges branch June 19, 2023 14:08

userTrades.forEach((trade) => {
nodes[trade.sellToken] = { address: trade.sellToken }
nodes[trade.sellToken] = { address: trade.buyToken }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just from pattern matching: nodes[trade.buyToken] in the second statement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

alfetopito added a commit that referenced this pull request Jun 28, 2023
* Hackaton/tenderly data loading (#530)

* chore: add getTransactionTrace and getTransactionContracts tenderly api fns

* chore: add hook to fetch unfiltered tx data

* Hackaton/nodes and edges (#531)

* refactor: rename `traceToTransfersAndTrades`

* chore: export all types from tenderly from index

* feat: add getContractTrades

* feat: add getNotesAndEdges

* fix: use buyToken address as a key for the buyToken address

* Hackaton/update graph (#532)

* refactor: a tiny bit of clean up on useTxBatchTrades

* chore: update graph

WIP

Messy commit, lots to describe and update still

* fix: edge colors now match user/amm interactions

* chore: pass down transfers to Node objs

* chore: use different node types for dex vs token nodes

* chore: use a different icon for token nodes

* chore: capture eth sell transfers

* refactor: remove repeated variable

* chore: add map of wrapped native token addresses

* chore: add link to hyper nodes

* chore: show address and link when token has no symbol

* chore: actually, always show link for all nodes

* chore: improve edge labels

* chore: add tooltip to edges

* chore: replace native token node with wrapped

* ore: add node type hyper

* chore: add dynamic stylesheet for token images

* chore: add token images to graph

* filter contract trades which only route tokens (#533)

---------

Co-authored-by: Felix Henneke <[email protected]>

* chore: add circle and concentric layouts (#535)

* Hackathon/integrate both visualizations (#537)

* refactor: rename const to all caps

* chore: wire up everything -- still WIP

* chore: more a ton of refactorings, still not working

* fix: enum comparison of same type was failing because one was a string the other a number

* chore: update layout once visualization changes

* fix: use proper type

* chore: remove debug statements

* refactor: remove unused hooks

* refactor: move buildContractBasedSettlement to TransactionBatchGraph

* refactor: move buildTokenBasedSettlement into settlementBuilder

* refactor: move node builder fns into nodesBuilder file

* refactor: move types to types file

* refactor: move hooks to hooks file

* chore: cache tenderly fetched data

* refactor: rename contract->transfer token->trades

* Merge edges for hypernodes + node tooltips (#536)

* added tooltip for nodes showing balance of token

* show dangeling edges

* merge transfers for hyper nodes

* use order information to filter for non-user trades

* clean up

address comments
- made isInternal in Transfer optional
- better sign for 0 in tool tip
- tooltip can be undefined. does still render stuff though.

* refactor: remove empty folder/file

* fix: do not create tooltip if it doesn't exist

* fix: adjust tooltip header width

* refactor: simplify styles

* fix: improve grid layout for trade based view

* fix: always use bezier style edges for trade based view

* refactor: simplify styles further

* chore: make concentric layout further spread out

* refactor: sort imports

* chore: load tokens which are not part of any order

* chore: start simple graphs in grid layout

* fix: reset zoom when visualization change and keep same layout

* fix: change filter logic from !== 1 to > 1

* fix: add dangling nodes back

* fix: add padding on top of graph to not overlap buttons

---------

Co-authored-by: Felix Henneke <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants